<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head th:replace="~{fragments/layout :: header}"></head>
<body>
    <div class="header">
        <h2>STK管理系统</h2>
        <div>
            <span th:text="${#authentication.name}"></span>
        </div>
    </div>

    <div class="container">
        <div th:replace="~{fragments/layout :: menu}"></div>
        
        <div class="content">
            <h2>欢迎使用STK管理系统</h2>
            <p>您已成功登录。</p>
            
            <div sec:authorize="hasRole('ADMIN')">
                <h3>管理员功能</h3>
                <ul>
                    <li><a th:href="@{/departments}">单位管理</a></li>
                </ul>
            </div>
            
            <div sec:authorize="hasRole('USER')">
                <h3>用户功能</h3>
                <p>普通用户界面</p>
            </div>
        </div>
    </div>

    <div class="footer">
        <p>Copyright © 2025 STK管理系统</p>
    </div>
</body>
</html>